
network WSN
{
    parameters:
        int numNodes;  //So nut cam bien
        double ssRange;   //Khoang cam bien
        double trRange;	//Khoang truyen tai
        double energy;	//nang luong cua sensor
        int frameNumber;
        string FILE_MOV1;
        double X_MAX;
        double Y_MAX;
        double targetSpeed;
        int nSensorPerCol;
        double rangeMax;        
        double TimeStep;
        double ProcessNoiseIntensity;
        //double MeasurementNoiseIntensity = 0.1 * ssRange / 3;  //sigma  -> noise max = 3*sigma = 10% * ssRange 
        int typeProtocol;
        int typeEstimate;
        int useFile;
        int typeTrajectory;
        double switchLevel;
        @display("bgb=640,540");
    submodules:
        target1: Target {
            parameters:
                FILE_OBJ_MOV = FILE_MOV1;
                O_ID = 1;
                X_MAX = X_MAX;
                Y_MAX = Y_MAX;
                @display("p=0,0");
        }
        
        ss[numNodes]: Sensor {
            parameters:
                ssRange = ssRange;
                trRange = trRange;
                frameNumber = frameNumber;
                energy = energy;
                X_MAX = X_MAX;
                Y_MAX = Y_MAX;
                xpos = intuniform(0, X_MAX);
                ypos = intuniform(0, Y_MAX);
                @display("p=$xpos,$ypos");
        }

        BS: Bastation {
            parameters:
                trRange = trRange;
                numNodes = numNodes;
                frameNumber = frameNumber;
                X_MAX = X_MAX;
                Y_MAX = Y_MAX;
                xpos = X_MAX / 2;
                ypos = Y_MAX;
                @display("p=$xpos,$ypos");
        }


    connections allowunconnected:
}
